package mock.servicesdirectory.premises.web.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;

public class AmendListAction extends ActionSupport implements ServletRequestAware {
	private HttpServletRequest request;
	private int premiseId;
	private String locationName;
	private String postCode; 
	private String address1;
	

	@Override
	public String execute() throws Exception {
		String txtName = (String)request.getParameter("locationName");
		locationName = txtName;
		
		String txtadd =(String)request.getParameter("address1");
		address1 = txtadd;
		String numPremise=(String) request.getParameter("premiseId");
		if(numPremise!=null){
			premiseId=Integer.parseInt(numPremise);
		}
		else{
			premiseId=-1;
		}
		String numPostCode=(String) request.getParameter("postCode");
		postCode=numPostCode;
		return SUCCESS;
	}

	public HttpServletRequest getServletRequest() {
		return request;
	}

	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}

	public void setPremiseId(int premiseId) {
		this.premiseId = premiseId;
	}

	public int getPremiseId() {
		return premiseId;
	}

	public void setLocationName(String locationName) {
		this.locationName = locationName;
	}

	public String getLocationName() {
		return locationName;
	}


	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getAddress1() {
		return address1;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getPostCode() {
		return postCode;
	}



}
